package com.bdzl.daoRepository;

import java.util.List;

import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.bdzl.pojo.Company;

public interface CompanyDao extends JpaRepository<Company, Integer> {

	List<Company> findByType(Integer i,Sort sort);

	Company findById(Integer companyId);

	
	@Modifying
	@Query(" update Company set name = :name , introduction = :search , border = :abroad  where id = :id ")
	void updatecom(@Param("id")Integer companyId, @Param("abroad")Integer abroad,@Param("name") String name, @Param("search")String search);

	
	@Modifying
	@Query(" update Company set  type = 0  where id = :id ")
	void updatecp(@Param("id")Integer companyId);

}
